library(tidyverse)
library(lubridate)PA 5.2: Jewel Heist
Dates and Times with lubridate
Note that the lubridate package is a dependency that is installed as part of the tidyverse package, but it is not automatically loaded.
In other words, you have already accomplished install.packages("lubridate") by default of installing the tidyverse, but you will always need to call library(lubridate).
Solve the Mystery
Just down the road in Montecito, CA several rare jewels went missing. The jewels were stolen and replaced with fakes, but detectives have not been able to solve the case. They are now calling in a data scientist to help parse their clues.
A camera was located near the building where the jewels went missing, so the detectives have provided you with a list of people who may have entered the building. This list includes the date and time they were spotted on the camera, in Pacific Standard Time (PST).
Unfortunately, the date and time of the jewel heist is not known. You have been hired to crack the case. Use the clues below to discover the thief’s identity.
# 214 total suspects
suspects <- read_csv("https://raw.githubusercontent.com/zoerehnberg/STAT331-S23/main/practice_activities/suspects.csv")Pay attention to the time zone that is assigned when the data are read in. How can you set the correct time zone?
- Based on the cleaning schedule for the room where the jewels are held, the heist was not committed in the morning.
# end with 112 suspects left- The room where the heist was committed is closed on Tuesdays and Thursdays (and there were no signs of forced entry), so the heist did not happen on those days.
# end with 78 suspects left- It is believed that the heist was committed within 5 weeks (35 days) of Thanksgiving 2022.
Pay attention to time zones!
# end with 11 suspects left- The detectives partially decoded a message from the thief to a notorious fence in Iceland. In it, the thief said the job would be done “after the sun sets for you, but before midnight.”
When does the sun set in Iceland at that time of year?
# end with 4 suspects left- The thief left behind a receipt at the scene of the crime. The receipt is smudged, but the day of the month is shown to be 22. It is thought that the heist took place no more than three days after the receipt was issued.
# end with 2 suspects left- The thief is amused by your efforts and has sent you a cryptic clue:
“The exact number of seconds between midnight on Jan 1, 1970 and the time I arrived on the scene is divisible by 6.”
# end with 1 suspect leftWho is the thief? Only one name should remain.